<html>
<head>
<title>TestNG:  Service层测试</title>
<link href="../testng.css" rel="stylesheet" type="text/css" />
<link href="../my-testng.css" rel="stylesheet" type="text/css" />

<style type="text/css">
.log { display: none;} 
.stack-trace { display: none;} 
</style>
<script type="text/javascript">
<!--
function flip(e) {
  current = e.style.display;
  if (current == 'block') {
    e.style.display = 'none';
    return 0;
  }
  else {
    e.style.display = 'block';
    return 1;
  }
}

function toggleBox(szDivId, elem, msg1, msg2)
{
  var res = -1;  if (document.getElementById) {
    res = flip(document.getElementById(szDivId));
  }
  else if (document.all) {
    // this is the way old msie versions work
    res = flip(document.all[szDivId]);
  }
  if(elem) {
    if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
  }

}

function toggleAllBoxes() {
  if (document.getElementsByTagName) {
    d = document.getElementsByTagName('div');
    for (i = 0; i < d.length; i++) {
      if (d[i].className == 'log') {
        flip(d[i]);
      }
    }
  }
}

// -->
</script>

</head>
<body>
<h2 align='center'>Service层测试</h2><table border='1' align="center">
<tr>
<td>Tests passed/Failed/Skipped:</td><td>15/1/0</td>
</tr><tr>
<td>Started on:</td><td>Wed Jan 09 10:15:36 CST 2013</td>
</tr>
<tr><td>Total time:</td><td>1 seconds (1781 ms)</td>
</tr><tr>
<td>Included groups:</td><td></td>
</tr><tr>
<td>Excluded groups:</td><td></td>
</tr>
</table><p/>
<small><i>(Hover the method name to see the test class name)</i></small><p/>
<table width='100%' border='1' class='invocation-passed'>
<tr><td colspan='4' align='center'><b>PASSED TESTS</b></td></tr>
<tr><td><b>Test method</b></td>
<td width="30%"><b>Exception</b></td>
<td width="10%"><b>Time (seconds)</b></td>
<td><b>Instance</b></td>
</tr>
<tr>
<td title='org.hy.service.simple.IUserServiceTest.createUser()'><b>createUser</b><br>Test class: org.hy.service.simple.IUserServiceTest</td>
<td></td>
<td>0</td>
<td>org.hy.service.simple.IUserServiceTest@89cf1e</td></tr>
<tr>
<td title='org.hy.service.simple.IUserServiceTest.createUserNameAndPwd()'><b>createUserNameAndPwd</b><br>Test class: org.hy.service.simple.IUserServiceTest</td>
<td></td>
<td>0</td>
<td>org.hy.service.simple.IUserServiceTest@89cf1e</td></tr>
<tr>
<td title='org.hy.service.simple.IUserServiceTest.createUserNameAndPwdWithException()'><b>createUserNameAndPwdWithException</b><br>Test class: org.hy.service.simple.IUserServiceTest</td>
<td></td>
<td>0</td>
<td>org.hy.service.simple.IUserServiceTest@89cf1e</td></tr>
<tr>
<td title='org.hy.service.UserServiceTest.deleteUser()'><b>deleteUser</b><br>Test class: org.hy.service.UserServiceTest</td>
<td></td>
<td>0</td>
<td>org.hy.service.UserServiceTest@cbf30e</td></tr>
<tr>
<td title='org.hy.service.UserServiceTest.dp()'><b>dp</b><br>Test class: org.hy.service.UserServiceTest</td>
<td></td>
<td>0</td>
<td>org.hy.service.UserServiceTest@cbf30e</td></tr>
<tr>
<td title='org.hy.service.UserServiceTest.findUserByEmail()'><b>findUserByEmail</b><br>Test class: org.hy.service.UserServiceTest</td>
<td></td>
<td>0</td>
<td>org.hy.service.UserServiceTest@cbf30e</td></tr>
<tr>
<td title='org.hy.service.UserServiceTest.findUserById()'><b>findUserById</b><br>Test class: org.hy.service.UserServiceTest</td>
<td></td>
<td>0</td>
<td>org.hy.service.UserServiceTest@cbf30e</td></tr>
<tr>
<td title='org.hy.service.UserServiceTest.findUsersByIds()'><b>findUsersByIds</b><br>Test class: org.hy.service.UserServiceTest</td>
<td></td>
<td>0</td>
<td>org.hy.service.UserServiceTest@cbf30e</td></tr>
<tr>
<td title='org.hy.service.UserServiceTest.findUsersByName()'><b>findUsersByName</b><br>Test class: org.hy.service.UserServiceTest</td>
<td></td>
<td>0</td>
<td>org.hy.service.UserServiceTest@cbf30e</td></tr>
<tr>
<td title='org.hy.service.UserServiceTest.insertUser()'><b>insertUser</b><br>Test class: org.hy.service.UserServiceTest</td>
<td></td>
<td>0</td>
<td>org.hy.service.UserServiceTest@cbf30e</td></tr>
<tr>
<td title='org.hy.service.simple.IUserServiceTest.register()'><b>register</b><br>Test class: org.hy.service.simple.IUserServiceTest<br>Parameters: User[id=40,name=<null>]</td>
<td></td>
<td>0</td>
<td>org.hy.service.simple.IUserServiceTest@89cf1e</td></tr>
<tr>
<td title='org.hy.service.UserServiceTest.updateUser()'><b>updateUser</b><br>Test class: org.hy.service.UserServiceTest</td>
<td></td>
<td>0</td>
<td>org.hy.service.UserServiceTest@cbf30e</td></tr>
<tr>
<td title='org.hy.service.simple.IUserServiceTest.verify()'><b>verify</b><br>Test class: org.hy.service.simple.IUserServiceTest<br>Parameters: tom@example.com, 123456, true</td>
<td></td>
<td>0</td>
<td>org.hy.service.simple.IUserServiceTest@89cf1e</td></tr>
<tr>
<td title='org.hy.service.simple.IUserServiceTest.verify()'><b>verify</b><br>Test class: org.hy.service.simple.IUserServiceTest<br>Parameters: tom@example.com, 12345678, false</td>
<td></td>
<td>0</td>
<td>org.hy.service.simple.IUserServiceTest@89cf1e</td></tr>
<tr>
<td title='org.hy.service.simple.IUserServiceTest.verifyWithException()'><b>verifyWithException</b><br>Test class: org.hy.service.simple.IUserServiceTest<br>Parameters: kk@example.com, 123456</td>
<td><div><pre>org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 20
	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
	at $Proxy19.selectOne(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:95)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40)
	at $Proxy20.findUserByEmail(Unknown Source)
	at org.hy.service.simple.UserServiceImpl.verify(UserServiceImpl.java:18)
	at org.hy.service.simple.IUserServiceTest.verifyWithException(IUserServiceTest.java:52)
	at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:158)
Caused by: org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 20
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:63)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355)
	... 38 more
... Removed 34 stack frames</pre></div><a href='#' onClick='toggleBox("stack-trace18107298", this, "Click to show all stack frames", "Click to hide stack frames")'>Click to show all stack frames</a>
<div class='stack-trace' id='stack-trace18107298'><pre>org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 20
	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
	at $Proxy19.selectOne(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:95)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40)
	at $Proxy20.findUserByEmail(Unknown Source)
	at org.hy.service.simple.UserServiceImpl.verify(UserServiceImpl.java:18)
	at org.hy.service.simple.IUserServiceTest.verifyWithException(IUserServiceTest.java:52)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
	at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:182)
	at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:158)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:194)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:707)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:128)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:767)
	at org.testng.TestRunner.run(TestRunner.java:617)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1203)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1128)
	at org.testng.TestNG.run(TestNG.java:1036)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 20
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:63)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355)
	... 38 more
</pre></div></td>
<td>0</td>
<td>org.hy.service.simple.IUserServiceTest@89cf1e</td></tr>
</table><p>
<table width='100%' border='1' class='invocation-skipped'>
<tr><td colspan='4' align='center'><b>SKIPPED TESTS</b></td></tr>
<tr><td><b>Test method</b></td>
<td width="30%"><b>Exception</b></td>
<td width="10%"><b>Time (seconds)</b></td>
<td><b>Instance</b></td>
</tr>
<tr>
<td title='org.hy.service.UserServiceTest.f()'><b>f</b><br>Test class: org.hy.service.UserServiceTest</td>
<td><div><pre>org.testng.TestNGException: 
Method f requires 2 parameters but 0 were supplied in the @Test annotation.
... Removed 23 stack frames</pre></div><a href='#' onClick='toggleBox("stack-trace6367194", this, "Click to show all stack frames", "Click to hide stack frames")'>Click to show all stack frames</a>
<div class='stack-trace' id='stack-trace6367194'><pre>org.testng.TestNGException: 
Method f requires 2 parameters but 0 were supplied in the @Test annotation.
	at org.testng.internal.Parameters.checkParameterTypes(Parameters.java:198)
	at org.testng.internal.Parameters.createParameters(Parameters.java:134)
	at org.testng.internal.Parameters.createParameters(Parameters.java:370)
	at org.testng.internal.Parameters.handleParameters(Parameters.java:447)
	at org.testng.internal.Invoker.handleParameters(Invoker.java:1384)
	at org.testng.internal.Invoker.createParameters(Invoker.java:1075)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1180)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:128)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:767)
	at org.testng.TestRunner.run(TestRunner.java:617)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1203)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1128)
	at org.testng.TestNG.run(TestNG.java:1036)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
</pre></div></td>
<td>0</td>
<td>org.hy.service.UserServiceTest@cbf30e</td></tr>
</table><p>
</body>
</html>